package com.cat.dynamicPlanning02;

import java.util.List;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/check-if-it-is-possible-to-split-array/?envType=problem-list-v2&envId=dynamic-programming
 * @create 2025/10/1 20:33
 * @since JDK17
 */

public class Solution12 {
    public boolean canSplitArray(List<Integer> nums, int m) {
        int n = nums.size();
        if (n <= 2) {
            return true;
        }

        for (int i = 0; i < n - 1; i++) {
            if (nums.get(i) + nums.get(i + 1) >= m) {
                return true;
            }
        }
        return false;
    }
}
